import complex_query from '@feidao/web/atom/nodejs/db/complex-query';
import { spaceid, systemid } from './atom/config';

interface Message {
}

/**
 * @description 使用sql函数max
 * @param
 */

export default async function atom(msg: Message, action_id: string, session_id: string) {
	const cquery = complex_query(action_id, spaceid, systemid);

	const res = await cquery.add_field('msz_test3', 'room', 'room')
		.add_fun('msz_test3', 'num', 'num_max', 'count')
		.groupby('msz_test3', 'room')
		.orderby('num_max')
		.exec();

	return res;
}
